<%@ page contentType="text/html; charset=utf-8"%>

<%@ include file="/WEB-INF/jsp/includeCss.jsp"%>
<%@ include file="/WEB-INF/jsp/includeJs.jsp"%>
<%@ include file="/WEB-INF/jsp/includeTaglib.jsp"%>


<table width="100%" border="0" cellpadding="0" cellspacing="5">
	<tr>
		<td valign="top">
			<table class="dbborder" width="100%" border="0" cellpadding="0"
				cellspacing="0">
				<tr>
					<td valign="bottom" class="blueTableBg">&nbsp;角色任务修改</td>
				</tr>
			</table>
		</td>
	</tr>
</table>

<div class="globalText" style="padding: 15px;border: solid 1px #999999;width: 768px;margin-left: 15px;" >
	<form target="tempFrame" id="roleTaskForm" method="post" action="<c:url value='/admin/editRoleTask.html' />">
		<table class="globalText dbborder" width="100%" border="0" cellpadding="5" cellspacing="5" style="margin: 5px;">
			
			<tr>
				<td>角色名称</td>
				<td>${permissionRoleAchievement.permissionRole.name}</td>
			</tr>
			<tr>
				<td>任务</td>
				<td><input readonly="readonly" value="${permissionRoleAchievement.job.name}" onclick="chooseTask();" id="jobId"  type="text" class="txtbox equired" size="20" /></td>
			</tr>
			<tr>
				<td>目标</td>
				<td>
					<input value="${permissionRoleAchievement.targetCount}" name="targetCount" class="txtbox required digits"  type="text" />
				</td>
			</tr>
			
			<tr>
				<td colspan="2" ><input style="margin-left: 150px;" onclick="javascript:$('#roleTaskForm').submit();" type="button" class=" btnStyle" value="提交" /></td>
			</tr>
		</table>
		
		<input type="hidden" name="jobId" value="${permissionRoleAchievement.job.id}" id="jobIdValue"/>
		<input type="hidden" name="id" value="${permissionRoleAchievement.id}" />
		<input type="hidden" name="roleId" value="${permissionRoleAchievement.permissionRole.id}" />
		
	</form>
</div>

<script>
	function chooseTask(){
		var a=window.showModalDialog('<c:url value="/admin/jobList.html" />',window,'status:no;resizable:no;directories:no;help:no;scroll:no;dialogWidth=800px;dialogHeight=450px;dialogLeft:500px;dialogTop:300px;');
		$('#jobId').val(a.jobName);
		$('#jobIdValue').val(a.jobId);
	}
	
	function jobListOnloadCallBack(subWindow){
		var subDocument=subWindow.document;
		$(subDocument).find('.delBtn').each(function(i){
			$(this).hide();
		});
		$(subDocument).find('.chooseBtn').each(function(i){
			$(this).show();
			$(this).bind("click",function(){
				subWindow.parent.window.returnValue={jobName:$(this).attr("jobName"),jobId:$(this).attr("jobId")};
				subWindow.close();
			});
		});
		$(subDocument).find('.editBtn').each(function(i){
			$(this).hide();
		});
	}
	
	function submitCallbackSuccess(obj){
		window.location="<c:url value="/admin/roleTaskList.html" />";
	}
	
	
	
	$().ready(function() {
		var validate=$("#roleTaskForm").validate({
			showErrors: customShowErrors,
			onfocusout:false,
			onkeyup:false,
			onclick:false
		});
	});
	
	
</script>



